/*
 * @文件描述: 
 * @版本: 
 * @作者: 周晨阳
 * @Date: 2021-08-17 10:00:09
 */
#include "LED.h"
#ifdef WIN_SIM  
/*
 * @文件描述:板载LED驱动
 * @版本:
 * @作者: 周晨阳
 * @Date: 2021-01-16 17:00:58
 */

#include "LED.h"
/* Private typedef -----------------------------------------------------------*/

/* Private define ------------------------------------------------------------*/
#define BOARD_LED_RED_PIN GPIO_Pin_9
#define BOARD_LED_GREEN_PIN GPIO_Pin_10
/* Private macro -------------------------------------------------------------*/

/* Private variables ---------------------------------------------------------*/

/* Private function prototypes -----------------------------------------------*/

/* Private functions ---------------------------------------------------------*/

/* Public functions ---------------------------------------------------------*/
/**
 * @brief : 板载LED初始化
 * @param {*}
 * @return {*}
 */
void LED_Init(void)
{
  printf("LED init done...\n");
}
/**
 * @brief : 开启对应LED
 * @param {uint8_t} led
 * @return {*}
 */
void openLed(uint8_t led)
{
  if (led == LED_RED)
  {
    // GPIO_ResetBits(GPIOF, BOARD_LED_RED_PIN); // 灯灭
  }
  else
  {
    // GPIO_ResetBits(GPIOF, BOARD_LED_GREEN_PIN); // 灯灭
  }
}
/**
 * @brief : 关闭对应LED
 * @param {uint8_t} led
 * @return {*}
 */
void closeLed(uint8_t led)
{
  if (led == LED_RED)
  {
    // GPIO_SetBits(GPIOF, BOARD_LED_RED_PIN); // 灯灭
  }
  else
  {
    // GPIO_SetBits(GPIOF, BOARD_LED_GREEN_PIN); // 灯灭
  }
}
/**
 * @brief : 反转LED状态
 * @param {uint8_t} led
 * @return {*}
 */
void trigLed(uint8_t led)
{
  if (led == LED_RED)
  {
  //   if (GPIO_ReadOutputDataBit(GPIOF, BOARD_LED_RED_PIN))
  //   {
  //     GPIO_ResetBits(GPIOF, BOARD_LED_RED_PIN);
  //   }
  //   else
  //   {
  //     GPIO_SetBits(GPIOF, BOARD_LED_RED_PIN);
  //   }
  // }
  // else
  // {
  //   if (GPIO_ReadOutputDataBit(GPIOF, BOARD_LED_GREEN_PIN))
  //   {
  //     GPIO_ResetBits(GPIOF, BOARD_LED_GREEN_PIN);
  //   }
  //   else
  //   {
  //     GPIO_SetBits(GPIOF, BOARD_LED_GREEN_PIN);
  //   }
  }
}

#endif // DEBUG